package com.ruoyi.project.baoxiu.card.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.baoxiu.card.mapper.OrderWarrantyCardMapper;
import com.ruoyi.project.baoxiu.card.domain.OrderWarrantyCard;
import com.ruoyi.project.baoxiu.card.service.IOrderWarrantyCardService;

/**
 * 保修订单Service业务层处理
 * 
 * @author wyh
 * @date 2024-08-17
 */
@Service
public class OrderWarrantyCardServiceImpl implements IOrderWarrantyCardService 
{
    @Autowired
    private OrderWarrantyCardMapper orderWarrantyCardMapper;

    /**
     * 查询保修订单
     * 
     * @param id 保修订单主键
     * @return 保修订单
     */
    @Override
    public OrderWarrantyCard selectOrderWarrantyCardById(Long id)
    {
        return orderWarrantyCardMapper.selectOrderWarrantyCardById(id);
    }

    /**
     * 查询保修订单列表
     * 
     * @param orderWarrantyCard 保修订单
     * @return 保修订单
     */
    @Override
    public List<OrderWarrantyCard> selectOrderWarrantyCardList(OrderWarrantyCard orderWarrantyCard)
    {
        return orderWarrantyCardMapper.selectOrderWarrantyCardList(orderWarrantyCard);
    }

    /**
     * 新增保修订单
     * 
     * @param orderWarrantyCard 保修订单
     * @return 结果
     */
    @Override
    public int insertOrderWarrantyCard(OrderWarrantyCard orderWarrantyCard)
    {
        orderWarrantyCard.setCreateTime(DateUtils.getNowDate());
        return orderWarrantyCardMapper.insertOrderWarrantyCard(orderWarrantyCard);
    }

    /**
     * 修改保修订单
     * 
     * @param orderWarrantyCard 保修订单
     * @return 结果
     */
    @Override
    public int updateOrderWarrantyCard(OrderWarrantyCard orderWarrantyCard)
    {
        return orderWarrantyCardMapper.updateOrderWarrantyCard(orderWarrantyCard);
    }

    /**
     * 批量删除保修订单
     * 
     * @param ids 需要删除的保修订单主键
     * @return 结果
     */
    @Override
    public int deleteOrderWarrantyCardByIds(Long[] ids)
    {
        return orderWarrantyCardMapper.deleteOrderWarrantyCardByIds(ids);
    }

    /**
     * 删除保修订单信息
     * 
     * @param id 保修订单主键
     * @return 结果
     */
    @Override
    public int deleteOrderWarrantyCardById(Long id)
    {
        return orderWarrantyCardMapper.deleteOrderWarrantyCardById(id);
    }
}
